from math import floor, fabs
from random import random, randint
a = [randint(-5, 5) for _ in range(randint(2, 32))]
n = len(a)
f = open('in.txt', 'w')
print(n, file=f)
for i in a:
    print(i, end=' ', file=f)

a = [(i, a[i]+1000) for i in range(len(a))]

rt = a[0]
v = [[-1, -1] for _ in range(2005)]  # 记录左右孩子
d = [0 for _ in range(1005)]  # 记录深度的桶
d[0] = 1


def add(fa, x, dep=1):
    idx, isR = fa[0], x[1] > fa[1]
    if v[idx][isR] == -1:
        v[idx][isR] = x
        d[dep] += 1
    else:
        add(v[idx][isR], x, dep+1)


for i in a[1:]:
    add(rt, i)

for i in range(1000, 0, -1):
    if d[i]:
        print(f'{d[i]} + {d[i-1]} = {d[i]+d[i-1]}', file=open('wa.txt', 'w'))
        break
